function upload(url, files, success,error) {
	let ta = this;
	//我们规定所有img 只能保存 dataurl 格式数据
	if (url == null) return;
	if (files == null) return;
	let fd = new FormData();
	let count = 0;
	for (let i = 0; i < files.length; i++) {
		let blob = files[i];
		img.mime = blob.type;
		//上传成功的文件名
		let ext = ta.getExtName(blob.type);
		let name = img.name;
		//console.log("name1",name)
		if (name == null || name == "") { //文件名 
			name = new Date().getTime() + "." + ext;
			img.name = name;
		}
		let path = img.path;
		//path是上传以后的访问路径,缺少path说明需要上传
		if (path == null || path == "" || path == "null") {
			count++;
			fd.append("image", blob, name);
		}
	}


	if (count == 0) return;
	//console.log(ta.上传路径)
	let xhr = new XMLHttpRequest();
	xhr.open("POST", url)
	//进度条
	xhr.onload = function(e) {
		//console.log(e);
		if (xhr.status == 200) { //
			let json = JSON.parse(xhr.responseText);
			let msg = JSON.parse(json.MSG);
			success(msg)
		}
	}
	xhr.onerror = function(e) {
		error(e)
	}
	xhr.send(fd);
}
